﻿using MediaBusiness.Dto;
using MediaBusiness.Utils;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows.Forms;

namespace MediaBusiness
{
    public partial class FrmDRM : Form
    {
        public FrmDRM()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            //string connStr = @"server=172.25.8.33;User Id=audit;password=WedoIptv@2017!;Persist Security Info=True;Character set=utf8;database=was;SslMode=none";
            //SugarDbContext.Init(connStr);
            //DataAssistantor.Instance.GetMediaMetainfo();

            StringBuilder sb = new StringBuilder();
            sb.Append("a");
            sb.Append(",");
            sb.Append("b");
            string result = sb.ToString();

            List<string> aa = new List<string>();
            aa.Add("a");
            aa.Add("b");
            aa.Add("c");
            string bb = string.Join(",", aa.ToArray());

            Console.WriteLine("aaa");

            //GetActor();
        }

        private void GetActor()
        {
            //MRS数据库访问信息 SQLServer
            //192.168.65.147 EasyFactory
            //songlili SRT@)!9sctv
            //创建链接
            ConnectionConfig conncfg = new ConnectionConfig()
            {
                DbType = SqlSugar.DbType.SqlServer,
                ConnectionString = @"Data Source=192.168.65.147;Initial Catalog=EasyFactory;User ID=songlili;Password=SRT@)!9sctv;Integrated Security=false; Trusted_Connection=false; "
            };
            
            using (SqlSugarClient dbClient = new SqlSugarClient(conncfg))
            {
                ActorDto dto = dbClient.Queryable<ActorDto>().First();
                if (dto != null)
                {
                    MessageBox.Show(dto.ActorName);
                }
                else
                {
                    MessageBox.Show("未查询到数据");
                }
            }
        }
    }
}
